package com.beiding.utils;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.HashMap;
import java.util.Map;

public class LogUtils {

    private static Map<Class,Log> logs=new HashMap<>();

    private static Log getLog(Class clazz)
    {
        if (logs.containsKey(clazz))
            return logs.get(clazz);

        Log r= LogFactory.getLog(clazz);
        logs.put(clazz,r);
        return r;
    }

    public static void info(Class clazz,Object info)
    {
        getLog(clazz).info(info);
    }
    public static void error(Class clazz,Object error){
        getLog(clazz).error(error);
    }




}
